.quarkdown {
  ul, ol {
    $margin: calc(var(--qd-paragraph-vertical-margin) * var(--qd-list-margin-multiplier));
    margin-top: $margin;
    margin-bottom: $margin;
    padding-left: 20px;

    &:has(> .task-list-item) {
      padding-left: 0;
    }
  }

  li {
    // Tight
    --qd-list-item-margin-multiplier: 0.75;
    $margin: calc(var(--qd-paragraph-vertical-margin) * var(--qd-list-margin-multiplier) * var(--qd-list-item-margin-multiplier));
    margin-top: $margin;
    margin-bottom: $margin;

    &:has(p) {
      // Loose
      --qd-list-item-margin-multiplier: 1.5;
    }

    // If a list item has a custom bullet element, the actual content is wrapped in a container
    &:has(> div:nth-child(2)) {
      display: flex;
      align-items: flex-start;
    }
  }

  // GFM task items
  .task-list-item {
    list-style-type: none;

    input[type="checkbox"]:first-child {
      margin-right: var(--qd-task-checkbox-margin-right);
      transform: translateY(1px);
    }
  }
}